﻿
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TestBat.IViewModels.Workspaces.Results;
using TestBat.IModels.Domain;

namespace TestBat.ViewModels.Workspaces.Results
{
    public class ResultTestMultipleResponseTaskViewModel : ResultTestTaskViewModel, IResultTestMultipleResponseTaskViewModel
    {
        public ResultTestMultipleResponseTaskViewModel(ITestMultipleResponseTask testTask)
            : base(testTask)
        {
            TestTask = testTask;
        }

        public IList<object> Choices
        {
            get
            {
                IList<object> o = new List<object>();
                foreach (var c in TestTask.Choices)
                    o.Add(new { Choice = c, Pick = ((IMultipleResponseSolution)TestTask.Solution).Picks.Contains(c) });
                return o;
            }
        }

        public ITestMultipleResponseTask TestTask { get; private set; }
    }
}
